<?php

/**
 +----------------------------------------------+
 * PHP Version 5.2.10                           *
 +----------------------------------------------+
 * 功能说明：实现文字的对齐效果
 * 备注：处理[align=对齐方式]内容[/align]
 +----------------------------------------------+
 * Author    ：九九                             *
 * QQ        ：405494897                        *
 * Email     ：xjiujiu@foxmail.com              *
 * Copyright ：2010/7/29                        *
 +----------------------------------------------+ 
**/
/**
* @name  alignUBBCode class
*/
class alignUBBCode extends UBBCode{
    
    public function __construct($content,$value,$UBBCode,$regExp){
        parent::__construct(&$content,$value,$UBBCode,$regExp); 
        $this->htmlCode     = "<p align={$this->value}>\\1</p>";
    }
    
    public function replaceUBBCode(){        
         if(($this->content = preg_replace($this->regExp,$this->htmlCode,$this->content,1)) == true){
            return true;
        }else{
            return false;
        }        
    }
}

?>